package com.xc.pattern.decorator;

/**
 * @author xingchen
 * @description 喇叭，角色 ConcreteDecorator
 * @create 2022-09-04 16:23
 */
public class SuonaBikeDecorator extends BikeDecorator {

    private String description = "增加一个喇叭 ";


    private Bike bike;

    public SuonaBikeDecorator(Bike bike) {
        this.bike = bike;
    }

    @Override
    public String getDescription() {
        return bike.getDescription() + "," + description;
    }

    /**
     * 50是唢呐喇叭的价格
     *
     * @return
     */
    @Override
    public int getPrice() {
        return bike.getPrice() + 50;
    }
}
